﻿// Models/PracticeAnswer.cs - 练习答案模型
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace WebApplication1.Models
{
    [Table("PracticeAnswers")]
    public class PracticeAnswer
    {
        [Key]
        public int AnswerId { get; set; }

        [Required]
        public int SessionId { get; set; }

        [Required]
        public int QuestionId { get; set; }

        public string UserAnswer { get; set; }

        public string UserAnswerText { get; set; }

        public bool IsCorrect { get; set; }

        public string CorrectAnswer { get; set; }

        public string CorrectAnswerText { get; set; }

        public DateTime AnswerTime { get; set; }

        // 导航属性
        [ForeignKey("SessionId")]
        public virtual PracticeSession PracticeSession { get; set; }

        [ForeignKey("QuestionId")]
        public virtual Question Question { get; set; }
    }
}